#include <iostream>
#include <ctime>
#include <cstdlib>

using namespace std;

int * getRandom()               //要生成和返回随机数的函数
{
    static int r[10];
    int i;

    srand((unsigned)time(NULL));//设置种子

    for(i = 0; i < 10; ++i)
    {
        r[i] = rand();
        cout << r[i] << endl;
    }

    return r;
}


int main()
{
    int *ip;
    int i;

    ip = getRandom();

    for(i = 0;i < 10; i++)
    {
        cout << "*(ip +" << i << ") : ";
        cout << *(ip + i) << endl;
    }

    return 0;
}
